import request from "@/utils/request";
import type { ResponseInfo,Record } from '@/api/product/BrandManage/type'

enum API {
  GETPRODUCTS_URL="/admin/product/baseTrademark/",
  ADDRODUCT_URL="/admin/product/baseTrademark/save",
  UPDATEPRODUCT_ULR="/admin/product/baseTrademark/update",
  DELPRODUCT_ULR="/admin/product/baseTrademark/remove/"
}
export const reqGetPructions= (page:number,limit:number) => request.get<any,ResponseInfo>(API.GETPRODUCTS_URL+page+'/'+limit)

export const reqAddOrUpdateProduct= (data:Record) => {
  if(data.id){
    return request.put<any,any>(API.UPDATEPRODUCT_ULR,data)
  } else{
    return request.post<any,any>(API.ADDRODUCT_URL,data)
  }
}

export const reqDelProduct= (Id:number) => request.delete<any,any>(API.DELPRODUCT_ULR+Id)
